package org.example.resp;

import java.io.Serializable;

/**
 * 统一响应格式
 * @param <T> 响应数据类型
 */
public class CommonResp<T> implements Serializable {
    private static final long serialVersionUID = 1L;
    
    /** 是否成功 */
    private boolean success = true;
    
    /** 响应信息 */
    private String message;
    
    /** 响应内容 */
    private T content;

    public boolean getSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getContent() {
        return content;
    }

    public void setContent(T content) {
        this.content = content;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("CommonResp{");
        sb.append("success=").append(success);
        sb.append(", message='").append(message).append('\'');
        sb.append(", content=").append(content);
        sb.append('}');
        return sb.toString();
    }
}